*Clear memory and call data file
*change path below to local requirements
clear
use "C:\Users\kamch\Dropbox\Temporary Tenacity Files\Materials for LSQ Resubmission\LSQ Resubmission\FINAL\Legislative Pensions.FINAL.13.4.2023.dta"

*drop federal observations from provinces w/o provincial comparisons
drop if PROVINCE < 5
drop if PROVINCE == 9
drop if PROVINCE > 10

//TABLE A.1: DESRIPTIVE STATISTICS
summ RAN_AGAIN DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED RATE ACCRUED OFFICE GOVERNMENT PAST_OFFICE AGEon SEX REAL MARGIN YRS_SERVICE  

asdoc summ RAN_AGAIN DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED RATE ACCRUED OFFICE GOVERNMENT PAST_OFFICE AGEon SEX REAL MARGIN YRS_SERVICE, replace format



//N records & individuals
gsort ID_C DATE
by ID_C: gen first_rec_C = _n==1

gsort ID_I DATE
by ID_I: gen first_rec_I = _n==1

*N of careers
tab first_rec_C

*N of individuals
tab first_rec_I

//Number of legislators who served in federal and provincial legislatures (related to text on p. 18 in manuscript)
tab MULTILEG if first_rec_I==1

//Distribution of dependent variable (related to text on p. 19 in manuscript)
tab RAN_AGAIN PARLIAMENT, col

//TABLE 2: Distribution of MPs’ pension arrangements across legislatures.

*Column 1: N w/o pensions by parliament
tab PARLIAMENT if DB_PENSIONit==0 & DC_PENSIONit==0

*Column 2: N w DC pensions - at individual-level (so could be grandfathered when plan changed to DC)
tab PARLIAMENT if DC_PENSIONit ==1

*Column 3: N enrolled in DB pensions - at individual-level (so could be grandfathered when plan changed to DC)
tab PARLIAMENT UNVESTED if DB_PENSIONit ==1

*Column 4 & 5 row subtotals: N vested in DB pensions - at individual-level (so could be grandfathered when plan changed to DC)
tab PARLIAMENT VESTED if DB_PENSIONit ==1

*Column 4: N vested in DB pensions - delayed
tab PARLIAMENT DELAYED if DB_PENSIONit ==1 & VESTED==1

*Column 5: N vested in DB pensions - delayed
tab PARLIAMENT IMMEDIATE if DB_PENSIONit ==1 & VESTED==1

*Column 6 & 7: Rate of accrual for those enrolled in DB pensions

mean RATE ACCRUED if VESTED==1, over(PARLIAMENT)

summ ACCRUED if DB_PENSIONit==1 & VESTED==1, det

*Column 8: N by parliament
tab PARLIAMENT


//ESTIMATES FOR TABLE 3
*Note: Needs reghde and ftools installed to run

*MODEL 1 -- H1: HOC BASELINE (via province FEs): the baseline effect of DB pensions
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(robust)
estimates store m1

*MODEL 2 -- H1: HOC BASELINE (via province FEs): the baseline effect of vesting in a DB pension
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit VESTED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(robust)
estimates store m2

*MODEL 3 -- H2b: HOC BASELINE (via province FEs): Isolating the vesting effect in DB pensions
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE VESTED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(robust)
estimates store m3

*MODEL 4 -- H3a: HOC BASELINE (via province FEs): Effect of delayed & immediate eligibility	
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE  c.IMMEDIATE c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR  i.PROVINCE) vce(robust)
estimates store m4

*MODEL 5 -- H4a: HOC BASELINE (via province FEs): The accrual limit effect
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(robust)
estimates store m5

*MODEL 6 -- HOC BASELINE (via province FEs): Do accrual and eligibility effects interact?  
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR  i.PROVINCE) vce(robust)
estimates store m6

*MODEL 7 -- HOC BASELINE (via province FEs): Does the accrual rate or limit drive the effect? 
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE##c.RATE##c.IMMEDIATE c.YRS_SERVICE##c.RATE##c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE)  vce(robust)
estimates store m7

*TABLE 3: LINEAR PROBABILITY ESTIMATES OF PR(MP SEEKS RE-ELECTION) (with Province FEs):
*Note: some coefficients in Table 3 presented with 2 significant digits; the code below produces all coefficients with 3 significant digits 
estout m1 m2 m3 m4 m5 m6 m7, drop(_cons) nolz nobase noomitted cells(b(star fmt(3)) se(par fmt(3))) stats(r2_a aic N,fmt(%9.2f %9.0g))starlevels(* 0.10 ** 0.05 *** 0.01) order (DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED ACCRUED c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED RATE c.YRS_SERVICE#c.RATE c.YRS_SERVICE#c.IMMEDIATE c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.DELAYED c.RATE#c.DELAYED c.YRS_SERVICE#c.RATE#c.DELAYED YRS_SERVICE AGEonENTRY REAL MARGIN SEX 1.OFFICE 1.GOVERNMENT 1.OFFICE#1.GOVERNMENT 1.PAST_OFFICE) varlabel (1.OFFICE "Office" 1.GOVERNMENT "Government" 1.OFFICE#1.GOVERNMENT "Office X Government" 1.PAST_OFFICE "Past Office" MARGIN "Margin" AGEonENTRY "Entry Age" SEX "Sex" REAL "Salary ($1,000s)" YRS_SERVICE "Service (Years)" DC_PENSIONit "DC Pension" DB_PENSIONit "DB Pension" RATE "Rate (%)" VESTED "Vested" IMMEDIATE "Immediate" DELAYED "Delayed" ACCRUED "Accrued" c.ACCRUED#c.IMMEDIATE "Accrued x Immediate" c.ACCRUED#c.DELAYED "Accrued x Delayed" c.YRS_SERVICE#c.RATE "Service x Rate" c.YRS_SERVICE#c.IMMEDIATE "Service x Immediate" c.RATE#c.IMMEDIATE "Rate x Immediate" c.YRS_SERVICE#c.RATE#c.IMMEDIATE "Service x Rate x Immediate" c.YRS_SERVICE#c.DELAYED "Service x Delayed" c.RATE#c.DELAYED "Rate x Delayed" c.YRS_SERVICE#c.RATE#c.DELAYED "Service x Rate x Delayed") noabbrev interaction(x) wrap  note("All models include legislature, year, legislature-year, and province fixed effects.") title("Table 3. The effect of variation in pension arrangements on MPs' propensity to seek re-election.") 


//FIGURE 1. PR(MP SEEKS RE-ELECTION) CONDITIONAL ON VESTION & ELIGIBILITY 
margins, at(YRS_SERVICE=(4(1)12) RATE=2 DELAYED=1 IMMEDIATE=0) at(YRS_SERVICE=(4(1)12) RATE=3 DELAYED=1 IMMEDIATE=0)at(YRS_SERVICE=(4(1)12) RATE=2 DELAYED=0 IMMEDIATE=1) at(YRS_SERVICE=(4(1)12) RATE=3 DELAYED=0 IMMEDIATE=1)
marginsplot, recastci(rarea) scheme(s1mono) level(95)

*You have to trick stata to get it to compute predicted probabilities for unvested MPs as if *YRS_SERVICE x RATE = 0.
*compute all the interactions manually & then compute margins:

gen RATExDELAYED = RATE*DELAYED
gen RATExIMMEDIATE = RATE*IMMEDIATE
gen YRS_SERVICExDELAYED = YRS_SERVICE*DELAYED
gen YRS_SERVICExIMMEDIATE = YRS_SERVICE*IMMEDIATE
gen YRS_SERVICExRATE = YRS_SERVICE*RATE
gen YRS_SERVICExRATExDELAYED = YRS_SERVICE*RATE*DELAYED
gen YRS_SERVICExRATExIMMEDIATE = YRS_SERVICE*RATE*IMMEDIATE

*Estimate model as above but w. manually constructed interactions:
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN RATE YRS_SERVICE IMMEDIATE DELAYED YRS_SERVICExRATE YRS_SERVICExIMMEDIATE YRS_SERVICExDELAYED RATExIMMEDIATE RATExDELAYED YRS_SERVICExRATExIMMEDIATE YRS_SERVICExRATExDELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE)  vce(robust)

*Estimate margins for unvested MPs at 4 years of service; superimpose these on above:
margins, at(YRS_SERVICE=4 RATE=2 YRS_SERVICExRATE=0 DELAYED=0 IMMEDIATE=0 YRS_SERVICExIMMEDIATE=0 YRS_SERVICExDELAYED=0 RATExIMMEDIATE=0 RATExDELAYED=0 YRS_SERVICExRATExIMMEDIATE=0 YRS_SERVICExRATExDELAYED=0) at(YRS_SERVICE=4 RATE=3 YRS_SERVICExRATE=0 DELAYED=0 IMMEDIATE=0 YRS_SERVICExIMMEDIATE=0 YRS_SERVICExDELAYED=0 RATExIMMEDIATE=0 RATExDELAYED=0 YRS_SERVICExRATExIMMEDIATE=0 YRS_SERVICExRATExDELAYED=0)




***Table A3: REPLICATES TABLE 3 IN MAIN TEXT WITH MP Fixed Effects
*MODEL 1 -- Baseline
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR i.ID_C) vce(robust)
estimates store a1

*MODEL 2 -- H1: Testing the baseline & vesting effect - includes province FE
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit VESTED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR i.ID_C) vce(robust)
estimates store a2

*MODEL 3 --  H2b: Testing the vesting effect - limited to DB pensions.
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE VESTED  if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.ID_C) vce(robust)
estimates store a3

*MODEL 4 -- H3a: Testing the eligibility effect dividing vested MPs into those w. delayed & immediate eligibility	
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE c.DB_PENSIONit c.IMMEDIATE c.DELAYED  if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR  i.ID_C) vce(robust)
estimates store a4

*MODEL 5 -- H4a: Testing the accrual limit effect
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.ID_C) vce(robust)
estimates store a5

*MODEL 6 -- Do accrual and eleibility effects interact?  
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR  i.ID_C) vce(robust)
estimates store a6

*MODEL 7 -- Is it the accrual rate or the limit that drives the effect? 
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE##c.RATE##c.IMMEDIATE c.YRS_SERVICE##c.RATE##c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1==1, abs(i.PARLIAMENT##i.YEAR i.ID_C) vce(robust)
estimates store a7

//Table A.3. Linear probability models of the effect of legislative pension plans on incumbents’ propensity to seek re-election controlling for MP fixed effects.
estout  a1 a2 a3 a4 a5 a6 a7, replace drop(_cons) nolz nobase noomitted cells(b(star fmt(3)) se(par fmt(3))) stats(r2_a aic N,fmt(%9.2f %9.0g))starlevels(* 0.10 ** 0.05 *** 0.01) order (DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED ACCRUED c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED RATE c.YRS_SERVICE#c.RATE c.YRS_SERVICE#c.IMMEDIATE c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.DELAYED c.RATE#c.DELAYED c.YRS_SERVICE#c.RATE#c.DELAYED YRS_SERVICE AGEonENTRY REAL MARGIN  SEX 1.OFFICE 1.GOVERNMENT 1.OFFICE#1.GOVERNMENT 1.PAST_OFFICE) varlabel (1.OFFICE "Office" 1.GOVERNMENT "Government" 1.OFFICE#1.GOVERNMENT "Office X Government" 1.PAST_OFFICE "Past Office" MARGIN "Margin" AGEonENTRY "Entry Age" SEX "Sex"   REAL "Salary ($1,000s)" YRS_SERVICE "Service (Years)" DC_PENSIONit "DC Pension" DB_PENSIONit "DB Pension" RATE "Rate (%)" VESTED "Vested" IMMEDIATE "Immediate" DELAYED "Delayed" ACCRUED "Accrued" c.ACCRUED#c.IMMEDIATE "Accrued x Immediate" c.ACCRUED#c.DELAYED "Accrued x Delayed" c.YRS_SERVICE#c.RATE "Service x Rate" c.YRS_SERVICE#c.IMMEDIATE "Service x Immediate" c.RATE#c.IMMEDIATE "Rate x Immediate" c.YRS_SERVICE#c.RATE#c.IMMEDIATE "Service x Rate x Immediate" c.YRS_SERVICE#c.DELAYED "Service x Delayed" c.RATE#c.DELAYED "Rate x Delayed" c.YRS_SERVICE#c.RATE#c.DELAYED "Service x Rate x Delayed") noabbrev interaction(x) wrap  note("All models include legislature, year, legislature-year, and MP fixed effects.") title("Table A3. The effect of variation in pension arrangements on MPs' propensity to seek re-election conditional on MP fixed effects.") 


***Table A4: REPLICATES TABLE 3 IN MAIN TEXT WITH SEs CLUSTERED BY MP
*MODEL 1 -- Baseline
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b1

*MODEL 2 -- H1: Testing the baseline & vesting effect - includes province FE
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit VESTED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b2

*MODEL 3 -- H2b: Testing the vesting effect - limited to DB pensions.
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE VESTED  if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b3

*MODEL 4 -- H3a: Testing the eligibility effect dividing vested MPs into those w. delayed & immediate eligibility	
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.DB_PENSIONit c.IMMEDIATE c.DELAYED  if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b4

*MODEL 5 -- H4a: Testing the accrual limit effect
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b5

*MODEL 6 -- Do accrual and eleibility effects interact?  
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b6

*MODEL 7 -- Is it the accrual rate or the limit that drives the effect? 
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE##c.RATE##c.IMMEDIATE c.YRS_SERVICE##c.RATE##c.DELAYED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1==1, abs(i.PARLIAMENT##i.YEAR i.PROVINCE) vce(cluster ID_C)
estimates store b7

estout b1 b2 b3 b4 b5 b6 b7, replace drop(_cons) nolz nobase noomitted cells(b(star fmt(3)) se(par fmt(3))) stats(r2_a aic N,fmt(%9.2f %9.0g))starlevels(* 0.10 ** 0.05 *** 0.01) order (DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED ACCRUED c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED RATE c.YRS_SERVICE#c.RATE c.YRS_SERVICE#c.IMMEDIATE c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.DELAYED c.RATE#c.DELAYED c.YRS_SERVICE#c.RATE#c.DELAYED YRS_SERVICE AGEonENTRY REAL MARGIN  SEX 1.OFFICE 1.GOVERNMENT 1.OFFICE#1.GOVERNMENT 1.PAST_OFFICE) varlabel (1.OFFICE "Office" 1.GOVERNMENT "Government" 1.OFFICE#1.GOVERNMENT "Office X Government" 1.PAST_OFFICE "Past Office" MARGIN "Margin" AGEonENTRY "Entry Age" SEX "Sex"   REAL "Salary ($1,000s)" YRS_SERVICE "Service (Years)" DC_PENSIONit "DC Pension" DB_PENSIONit "DB Pension" RATE "Rate (%)" VESTED "Vested" IMMEDIATE "Immediate" DELAYED "Delayed" ACCRUED "Accrued" c.ACCRUED#c.IMMEDIATE "Accrued x Immediate" c.ACCRUED#c.DELAYED "Accrued x Delayed" c.YRS_SERVICE#c.RATE "Service x Rate" c.YRS_SERVICE#c.IMMEDIATE "Service x Immediate" c.RATE#c.IMMEDIATE "Rate x Immediate" c.YRS_SERVICE#c.RATE#c.IMMEDIATE "Service x Rate x Immediate" c.YRS_SERVICE#c.DELAYED "Service x Delayed" c.RATE#c.DELAYED "Rate x Delayed" c.YRS_SERVICE#c.RATE#c.DELAYED "Service x Rate x Delayed") noabbrev interaction(x) wrap  note("All models include legislature, year, and legislature-year fixed effects.") title("Table A4. The effect of variation in pension arrangements on MPs' propensity to seek re-election with standard errors clustered by MP.") 



***Table A5. ESTIMATES MODELS IN TABLE 3 IN MAIN TEXT VIA LOGISTIC REGRESSION.
*MODEL 1 -- Baseline
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit i.PARLIAMENT##i.YEAR i.PROVINCE if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), vce(robust) or
estimates store c1

*MODEL 2 -- H1: Testing the baseline & vesting effect - includes province FE
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit VESTED if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), vce(robust)
estimates store c2

*MODEL 3 -- H2b: Testing the vesting effect - limited to DB pensions.
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE VESTED  i.PARLIAMENT##i.YEAR i.PROVINCE if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, vce(robust)
estimates store c3

*MODEL 4 -- H3a: Testing the eligibility effect dividing vested MPs into those w. delayed & immediate eligibility	
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.DB_PENSIONit c.IMMEDIATE c.DELAYED  i.PARLIAMENT##i.YEAR i.PROVINCE if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, vce(robust)
estimates store c4

*MODEL 5 -- H4a: Testing the accrual limit effect
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED  i.PARLIAMENT##i.YEAR i.PROVINCE if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, vce(robust)
estimates store c5

*MODEL 6 -- Do accrual and eligbility effects interact?  
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED  i.PARLIAMENT##i.YEAR i.PROVINCE if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, vce(robust)
estimates store c6

*MODEL 7 -- Is it the accrual rate or the limit that drives the effect? 
logit RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX  c.REAL c.MARGIN c.YRS_SERVICE##c.RATE##c.IMMEDIATE c.YRS_SERVICE##c.RATE##c.DELAYED  i.PARLIAMENT##i.YEAR i.PROVINCE if ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, vce(robust)
estimates store c7

estout c1 c2 c3 c4 c5 c6 c7, drop(_cons *.PARLIAMENT *.YEAR *.PROVINCE ) nolz nobase noomitted cells(b(star fmt(3)) se(par fmt(3))) stats(r2_p aic N,fmt(%9.2f %9.0g))starlevels(* 0.10 ** 0.05 *** 0.01) order (DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED ACCRUED c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED RATE c.YRS_SERVICE#c.RATE c.YRS_SERVICE#c.IMMEDIATE c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.DELAYED c.RATE#c.DELAYED c.YRS_SERVICE#c.RATE#c.DELAYED YRS_SERVICE AGEonENTRY REAL MARGIN  SEX 1.OFFICE 1.GOVERNMENT 1.OFFICE#1.GOVERNMENT 1.PAST_OFFICE) varlabel (1.OFFICE "Office" 1.GOVERNMENT "Government" 1.OFFICE#1.GOVERNMENT "Office X Government" 1.PAST_OFFICE "Past Office" MARGIN "Margin" AGEonENTRY "Entry Age" SEX "Sex"   REAL "Salary ($1,000s)" YRS_SERVICE "Service (Years)" DC_PENSIONit "DC Pension" DB_PENSIONit "DB Pension" RATE "Rate (%)" VESTED "Vested" IMMEDIATE "Immediate" DELAYED "Delayed" ACCRUED "Accrued" c.ACCRUED#c.IMMEDIATE "Accrued x Immediate" c.ACCRUED#c.DELAYED "Accrued x Delayed" c.YRS_SERVICE#c.RATE "Service x Rate" c.YRS_SERVICE#c.IMMEDIATE "Service x Immediate" c.RATE#c.IMMEDIATE "Rate x Immediate" c.YRS_SERVICE#c.RATE#c.IMMEDIATE "Service x Rate x Immediate" c.YRS_SERVICE#c.DELAYED "Service x Delayed" c.RATE#c.DELAYED "Rate x Delayed" c.YRS_SERVICE#c.RATE#c.DELAYED "Service x Rate x Delayed") noabbrev interaction(x) wrap  note("All models include legislature, year, legislature-year, and province fixed effects. Cell entries are logistic regression coefficients with heteroscedasticity consistent standard errors in parentheses.") title("Table A5. Logistic regression models of the effect of variation in pension arrangements on MPs' propensity to seek re-election.") 



***TABLE A.6: RE-ESTIMATES MODELS IN TABLE 3 USING QUEBEC MPS AS BASELINE. FEDERAL MPS ARE OMITTED
 
*MODEL 1 -- H1: QUEBEC BASELINE (omitting HOC & province FEs): the baseline effect of DB pensions
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR) vce(robust) 
estimates store q1

*MODEL 2 -- H1: QUEBEC BASELINE (omitting HOC & province FEs): the baseline effect of vesting in a DB pension
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE DC_PENSIONit c.DB_PENSIONit VESTED if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973), abs(i.PARLIAMENT##i.YEAR) vce(robust)
estimates store q2

*MODEL 3 -- H2b: QUEBEC BASELINE (omitting HOC & province FEs): Isolating the vesting effect in DB pensions
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE VESTED if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR) vce(robust)
estimates store q3

*MODEL 4 -- H3a: QUEBEC BASELINE (omitting HOC & province FEs): Effect of delayed & immediate eligibility		
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE  c.IMMEDIATE c.DELAYED if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR) vce(robust)
estimates store q4

*MODEL 5 -- H4a: QUEBEC BASELINE (omitting HOC & province FEs): The accrual limit effect
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR) vce(robust)
estimates store q5

*MODEL 6 -- QUEBEC BASELINE (omitting HOC & province FEs): Do accrual and eligibility effects interact?
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR) vce(robust)
estimates store q6

*MODEL 7 -- QUEBEC BASELINE (omitting HOC & province FEs): Does the accrual rate or limit drive the effect? 
reghdfe RAN_AGAIN  i.OFFICE##i.GOVERNMENT i.PAST_OFFICE AGEonENTRY SEX c.REAL c.MARGIN c.YRS_SERVICE##c.RATE##c.IMMEDIATE c.YRS_SERVICE##c.RATE##c.DELAYED if PARLIAMENT~=1 & ((PROVINCE==6|PROVINCE==7) & YEAR>=1945|PROVINCE==8 & YEAR>=1953|PROVINCE==10 & YEAR>=1975|PROVINCE==5 & YEAR>=1973) & ONLYinDB==1, abs(i.PARLIAMENT##i.YEAR) vce(robust)
estimates store q7

estout  q1 q2 q3 q4 q5 q6 q7, drop(_cons) nolz nobase noomitted cells(b(star fmt(3)) se(par fmt(3))) stats(r2_a aic N,fmt(%9.2f %9.0g))starlevels(* 0.10 ** 0.05 *** 0.01) order (DC_PENSIONit DB_PENSIONit VESTED IMMEDIATE DELAYED ACCRUED c.ACCRUED#c.IMMEDIATE c.ACCRUED#c.DELAYED RATE c.YRS_SERVICE#c.RATE c.YRS_SERVICE#c.IMMEDIATE c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.RATE#c.IMMEDIATE c.YRS_SERVICE#c.DELAYED c.RATE#c.DELAYED c.YRS_SERVICE#c.RATE#c.DELAYED YRS_SERVICE AGEonENTRY REAL MARGIN  SEX 1.OFFICE 1.GOVERNMENT 1.OFFICE#1.GOVERNMENT 1.PAST_OFFICE) varlabel (1.OFFICE "Office" 1.GOVERNMENT "Government" 1.OFFICE#1.GOVERNMENT "Office X Government" 1.PAST_OFFICE "Past Office" MARGIN "Margin (%)" AGEonENTRY "Entry Age" SEX "Sex" REAL "Salary ($1,000s)" YRS_SERVICE "Service (Years)" DC_PENSIONit "DC Pension" DB_PENSIONit "DB Pension" RATE "Rate (%)" VESTED "Vested" IMMEDIATE "Immediate" DELAYED "Delayed" ACCRUED "Accrued" c.ACCRUED#c.IMMEDIATE "Accrued x Immediate" c.ACCRUED#c.DELAYED "Accrued x Delayed" c.YRS_SERVICE#c.RATE "Service x Rate" c.YRS_SERVICE#c.IMMEDIATE "Service x Immediate" c.RATE#c.IMMEDIATE "Rate x Immediate" c.YRS_SERVICE#c.RATE#c.IMMEDIATE "Service x Rate x Immediate" c.YRS_SERVICE#c.DELAYED "Service x Delayed" c.RATE#c.DELAYED "Rate x Delayed" c.YRS_SERVICE#c.RATE#c.DELAYED "Service x Rate x Delayed") noabbrev interaction(x) wrap  note("All models include legislature, year, and legislature-year.") title("Table A6. The effect of variation in pension arrangements on MPs' propensity to seek re-election, excluding federal MPs and using Quebec MPs as controls.") 













